package models;

import play.db.jpa.Model;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Дисциплина
 *
 * User: Администратор
 * Date: 11.06.12
 * Time: 16:08
 * To change this template use File | Settings | File Templates.
 */
@Entity
@Table(name = "groups")
public class Group extends Model {

    @ManyToOne(targetEntity = FacultyCourseSpecialty.class)
    public FacultyCourseSpecialty facultyCourseSpecialty;
    public Integer numberOfStudents;
    public String formOfEducation;
    public Date enterDate;
    public Date finishDate;

    @OneToMany(fetch = FetchType.LAZY)
    public List<Student> students = new ArrayList<Student>();

    public Group(FacultyCourseSpecialty facultyCourseSpecialty, Integer numberOfStudents,
                 String formOfEducation, Date enterDate, Date finishDate) {
        this.facultyCourseSpecialty = facultyCourseSpecialty;
        this.numberOfStudents = numberOfStudents;
        this.formOfEducation = formOfEducation;
        this.enterDate = enterDate;
        this.finishDate = finishDate;
    }

}
